package com.ruoyi.system.service.aggregation.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.aggregation.Proportion;
import com.ruoyi.system.mapper.aggregation.ProportionMapper;
import com.ruoyi.system.service.aggregation.IProportionService;

/**
 * 分佣比例Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-01
 */
@Service
public class ProportionServiceImpl implements IProportionService 
{
    @Autowired
    private ProportionMapper proportionMapper;

    @Override
    public Proportion selectProportionById(Long id)
    {
        return proportionMapper.selectProportionById(id);
    }

    @Override
    public List<Proportion> selectProportionList(Proportion proportion)
    {
        return proportionMapper.selectProportionList(proportion);
    }

    @Override
    public int insertProportion(Proportion proportion)
    {
        proportion.setCreateTime(DateUtils.getNowDate());
        proportion.setDeleted(0);
        return proportionMapper.insertProportion(proportion);
    }

    @Override
    public int updateProportion(Proportion proportion)
    {
        proportion.setUpdateTime(DateUtils.getNowDate());
        return proportionMapper.updateProportion(proportion);
    }

    @Override
    public int deleteProportionById(Long id)
    {
        return proportionMapper.deleteProportionById(id);
    }
}

